/*
    * Copyright (c) 2024 Hunan OpenValley Digital Industry Development Co., Ltd.
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    *     http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
 */

#include "file_share_callback.h"

namespace OHOS {
namespace FileShare {

FileShareCallback::FileShareCallback()
{
}

FileShareCallback::~FileShareCallback()
{
}
int32_t FileShareCallback::OnSendEvent(SendState state, SendInfo &info)
{
    CHKPTR(sendFileCallback_, FS_NULL_PARAM);
    sendFileCallback_->OnSending(state, info);

    return FS_SUCCESS;
}

int32_t FileShareCallback::SetSendFileCallback(const std::shared_ptr<SendFileCallback> &callback)
{
    CHKPTR(callback, FS_NULL_PARAM);
    sendFileCallback_ = callback;

    return FS_SUCCESS;
}

int32_t FileShareCallback::SetShareStatusCallback(const std::shared_ptr<ShareStatusCallback> &callback)
{
    CHKPTR(callback, FS_NULL_PARAM);
    shareStatusCallback_ = callback;

    return FS_SUCCESS;
}

int32_t FileShareCallback::OnShareStatusEvent(bool shareStatus)
{
    CHKPTR(shareStatusCallback_, FS_NULL_PARAM);
    shareStatusCallback_->OnShareStatus(shareStatus);

    return FS_SUCCESS;
}
} // namespace FileShare
} // namespace OHOS